package com.bestom.waterquality.logic;

import android.content.Context;
import android.content.Intent;
import android.provider.Settings;
import android.view.View;

import com.bestom.waterquality.R;

/**
 * Lan 界面
 */
public class LanInterface {

    private Context mContext;

    private LanInterface() {
    }

    private static LanInterface _instance = null;

    public static LanInterface getInstance() {
        if (_instance == null)
            _instance = new LanInterface();
        return _instance;
    }

    public void setDataAndListen(Context context, View view){

        if (mContext == null){
            mContext = context;
            view.findViewById(R.id.go_lan).setOnClickListener(v -> {
                Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
                intent.putExtra(":settings:show_fragment_as_subsetting", true);
                context.startActivity(intent);
            });

        }
    }
}
